//
//  DnPhotoGridView.m
//  DnPhotoGallery	
//
//  Created by Ngoc on 12/12/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "DnPhotoGridView.h"


@implementation DnPhotoGridView
@synthesize delegate =_delegate, datasource =_datasource, pagingView=_pagingView;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _pagingView = [[ATPagingView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        _pagingView.pageBackgroundColor = [UIColor orangeColor];
        //_pagingView.delegate = self;
        _pagingView.currentPageIndex =0;
        [self addSubview:_pagingView];
    }
    return self;
}
-(void) setUpWithDefaultValue
{
 
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/
//- (NSInteger)numberOfPagesInPagingView:(ATPagingView *)pagingView
//{
//    return [self.datasource numberOfPagesInGridView:self];
//}
//
//
//- (UIView *)viewForPageInPagingView:(ATPagingView *)pagingView atIndex:(NSInteger)index
//{
//    
//    return [self.datasource gridView:self pageAtPageIndex:index];
//}
-(void) reloadData
{
    [_pagingView reloadData];
    
}
- (void)dealloc
{
    [_pagingView  release];
    _pagingView = nil;
    [super dealloc];
}

@end
